home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / Re DoIdle.4 < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  1.4 KB  |  [TEXT/ttxt]

  1. Subject:     Re: DoIdle
  2. Sent:        6/13/96 11:28 PM
  3. Received:    6/14/96 9:17 AM
  4. From:        Arni McKinley, motion@nbn.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. >If anyone has an example of idling a non-target frame (from the frame's
  9. >class), I would still be interested in seeing how it is done.
  10.  
  11.  
  12. I have a LabelShape (a CBaseShape in ODFDraw or Sketch code) that requires
  13. an idler in order to blink the caret in the label. When it gets to be time
  14. to edit the label I make an FW_CEditView then do this:
  15.   in EditLabel()
  16.      fEditView->Enable(ev);
  17.         fEditView->BecomeTarget( ev );
  18.  
  19.         if( fIdler == NULL )
  20.         {
  21.                 fIdler = FW_NEW(FW_CIdler, (fEditView->GetFrame(ev), 5));
  22.                 fIdler->RegisterIdle(ev);
  23.         }
  24.  
  25. Later when the Label is deselected by the user I do this
  26. in SelectLabel( FW_Boolean state )
  27.     if( !state)
  28.     {
  29.        fEditView->Disable(ev);
  30.        if( fIdler )
  31.        {
  32.            fIdler->UnregisterIdle( ev );
  33.  
  34.            delete fIdler;
  35.            fIdler = NULL;
  36.         }
  37.     }
  38.  
  39. Sometime or other, you need to delete the idler. I do it when the Edit View
  40. is deleted
  41.                 if( fIdler )
  42.                 {
  43.                         fIdler->UnregisterIdle( ev );
  44.  
  45.                         delete fIdler;
  46.                         fIdler = NULL;
  47.                 }
  48.  
  49. Hope this helps
  50.  
  51. Arni
  52.  
  53.  
  54.